<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
/**
 * Template Name: Standard Width Category
 *
 * This template allows you to display the latest posts on any
 * page of the site from a specific category that is specified
 * from the Page Category Meta Box.
 *
 * (c) 2011 by Mike Walsh
 *
 * @author Mike Walsh <mike@walshcrew.com>
 * @package casl-soccer
 * @subpackage templates
 * @version $Revision$
 * @lastmodified $Author$
 * @lastmodifiedby $Date$
 *
 */


// calling the header.php
get_header() ;

// action hook for placing content above #container
thematic_abovecontainer() ;

?>

<div id="container">
<?php thematic_abovecontent() ; ?>
<div id="content">

<?php
    $cat_id = get_post_meta($post->ID, '_casl_page_cat', true) ;
    $cat_name = get_cat_name($cat_id) ;
    $cat_slug = casl_get_cat_slug($cat_id) ;

    //  Set up the query arguments, in particular, pull the 
    //  category id for the page and only show those posts.

    $args = array(
        'cat' => $cat_id
       ,'posts_per_page' => get_option( 'posts_per_page' )
       ,'paged' => $paged
    ) ;

    //  Create a new query instance and submit it.

    $wp_query = new WP_Query() ;
    $wp_query->query($args) ;
    $more = 0 ;
?>

<?php 
                
    // create the navigation above the content
    thematic_navigation_above();
    

    // calling the widget area 'index-top'
    get_sidebar('index-top');
    
    printf('<h2 class="std-width-category">Posted under:  %s</h2>', $cat_name) ;

    // action hook for placing content above the index loop
    thematic_above_indexloop();
                
    // action hook creating the index loop
    thematic_indexloop();
                
    // action hook for placing content below the index loop
    thematic_below_indexloop();
                
    // calling the widget area 'index-bottom'
    get_sidebar('index-bottom');
                
    // create the navigation below the content
    thematic_navigation_below();
                
?>
                
</div><!-- #content -->
        
<?php thematic_belowcontent(); ?> 
        
</div><!-- #container -->

<?php 

    // action hook for placing content below #container
    thematic_belowcontainer();

    // calling the standard sidebar 
    thematic_sidebar();
    
    // calling footer.php
    get_footer();

?>
